// NFC_05 [FrameWindow using Inheritance].nova // Using namespace declarations. using Library.NFC; // The application class. class FrameWindowUsingInheritanceApp { // Application class's "main" function. public static void main( String[] args ) { // Create a new window. MyWindow window = new MyWindow( "NFC_05 [FrameWindow using Inheritance]", 320, 240 ); // Show the window. window.show( true ); // Process the window's events. window.processEvents( ); } } // Custom frame window class. class MyWindow : FrameWindow { // Class constructor. public MyWindow( String name, int sizeX, int sizeY ) : FrameWindow( name, sizeX, sizeY ) { // NOTE: "onInit" is called as the new window object is being created, // therefore "onInit" is called before this constructor code. // Output a message. Stream.writeLine( "MyWindow( String name, int sizeX, int sizeY )" ); } // onInit event handler. public virtual void onInit( ) { // Output a message. Stream.writeLine( "void onInit( )" ); } // onPaint event handler. public virtual void onPaint( ) { // Draw a string inside the frame window. graphics.drawString( "FrameWindow using Inheritance", 50, 25 ); } // onClose event handler. public virtual void onClose( ) { // Output a message. Stream.writeLine( "void onClose( )" ); } }